package com.txunda.zhuohired.http.pst;

import com.ants.theantsgo.base.BasePresenter;
import com.ants.theantsgo.base.BaseView;
import com.txunda.zhuohired.http.Company;

import java.io.File;

/**
 * 创建人： Txd_Cjh
 * 创建时间： 2018/3/29 11:13
 * 功能描述：企业认证
 * 联系方式：jiahuanchen@126.com
 */

public class CompanyPst extends BasePresenter {
    private Company company;

    public CompanyPst(BaseView baseView) {
        super(baseView);
        company = new Company();
    }

    /**
     * 获取规模
     */
    public void scale() {
//        baseView.showDialog();
        company.scale(baseView);
    }

    /**
     * 企业认证提价
     *
     * @param company_name     企业名称
     * @param trade_id         行业id
     * @param scale_id         规模id
     * @param address_province 企业地址-省
     * @param address_city     企业地址-市
     * @param address_area     企业地址-区
     * @param company_desc     企业简介
     * @param company_phone    行政电话
     * @param logo             企业logo
     * @param company_pic      企业风采
     */
    public void companyIn(String token, String company_name, String trade_id, String scale_id, String address_province,
                          String address_city, String address_area, String company_desc, String company_phone, File
                                  logo, File company_pic, String address_street, String address_door) {
        baseView.showDialog();
        company.companyIn(token, company_name, trade_id, scale_id, address_province, address_city, address_area,
                company_desc, company_phone, logo, company_pic, address_street, address_door, baseView);
    }

    /**
     * 企业认证法人提交
     *
     * @param business_license 营业执照图片
     * @param identity_card    身份证图片
     * @param token            登录注册回传的id
     */
    public void companyLegalIn(File business_license, File identity_card, String token) {
        baseView.showDialog();
        company.companyLegalIn(business_license, identity_card, token, baseView);
    }

    /**
     * 审核失败
     *
     * @param id 登录注册回传的id
     */
    public void companyError(String id) {
        baseView.showDialog();
        company.companyError(id
                , baseView);
    }

    /**
     * 推荐首页
     *
     * @param token
     * @param trade_id
     * @param p
     * @param order
     * @param shooling
     * @param experience
     * @param salary
     */
    public void shareIndex(String token, String trade_id, String p, String order,
                           String shooling, String experience, String salary) {
        baseView.showDialog();
        company.shareIndex(token, trade_id, p, order, shooling, experience, salary, baseView);
    }

    /**
     * 发布职位检查
     *
     * @param token
     */
    public void checkPostJob(String token) {
        baseView.showDialog();
        company.checkPostJob(token, baseView);
    }

    /**
     * 查看发布职位
     * @param job_type
     * @param status_type
     * @param p
     * @param token
     */
    public void isjobList(String token, String job_type, String status_type,String p) {
        baseView.showDialog();
        company.isjobList(token, job_type, status_type,p, baseView);
    }

    /**
     * 获取公司名称
     *
     * @param token
     */
    public void companyName(String token) {
        baseView.showDialog();
        company.companyName(token, baseView);
    }

    /**
     * 发布全职职位
     *
     * @param position_id
     * @param token
     * @param recruit
     * @param address_province
     * @param address_city
     * @param address_area
     * @param address_street
     * @param address_door
     * @param work_time
     * @param welfare
     * @param recruit_lat
     * @param recruit_lng
     * @param salary_min
     * @param salary_max
     * @param claim_experience
     * @param claim_shooling
     * @param position_good
     * @param job_claim
     * @param job_duty
     * @param job_id
     */
    public void allPublishJob(String position_id, String token, String recruit,
                              String address_province, String address_city,
                              String address_area, String address_street,
                              String address_door, String work_time,
                              String welfare, String recruit_lat, String recruit_lng,
                              String salary_min, String salary_max,
                              String claim_experience, String claim_shooling,
                              String position_good, String job_claim,
                              String job_duty, String job_id) {
        baseView.showDialog();
        company.allPublishJob(position_id, token, recruit, address_province, address_city
                , address_area, address_street, address_door, work_time, welfare
                , recruit_lat, recruit_lng, salary_min, salary_max, claim_experience
                , claim_shooling, position_good, job_claim, job_duty, job_id, baseView);
    }

    /**
     * 发布兼职职位
     *
     * @param token
     * @param position_id
     * @param merger_name
     * @param address_province
     * @param address_city
     * @param address_area
     * @param merger_lat
     * @param merger_lng
     * @param merger_address
     * @param date_start
     * @param date_end
     * @param work_time
     * @param clearing
     * @param merger_price
     * @param merger_claim
     * @param merger_responsibility
     * @param merger_education
     * @param merger_experience
     * @param job_id
     */

    public void partPublishJob(String token, String position_id,
                               String merger_name, String address_province,
                               String address_city, String address_area,
                               String merger_lat, String merger_lng,
                               String merger_address, String date_start,
                               String date_end, String work_time,
                               String clearing, String merger_price,
                               String merger_claim, String merger_responsibility,
                               String merger_education, String merger_experience,
                               String job_id) {
        baseView.showDialog();
        company.partPublishJob(token, position_id, merger_name, address_province, address_city
                , address_area, merger_lat, merger_lng, merger_address, date_start
                , date_end, work_time, clearing, merger_price, merger_claim
                , merger_responsibility, merger_education, merger_experience, job_id, baseView);
    }

    /**
     * 全职职位修改
     *
     * @param token
     * @param job_id
     */
    public void updateAllJob(String token, String job_id) {
        baseView.showDialog();
        company.updateAllJob(token, job_id, baseView);
    }


    /**
     * 兼职职位修改
     *
     * @param token
     * @param job_id
     */
    public void updatePartJob(String token, String job_id) {
        baseView.showDialog();
        company.updatePartJob(token, job_id, baseView);
    }


}
